package com.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dao.SubjectDAO;
import com.pojo.Subject;
import com.vo.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SubjectService {
    @Autowired
    private SubjectDAO subjectDAO;

    /**
     * 查询所有可用的科目
     * @return
     */
    public List findBySubjectId() {
        QueryWrapper<Subject> queryWrapper = new QueryWrapper<>();
        //添加条件为"subject_start"字段的值为0
        queryWrapper.eq("subject_start", 1);
        //查询所有状态为1（可用）的科目
        List<Subject> list = subjectDAO.selectList(queryWrapper);
        return list;
    }
}
